#define _CRT_SECURE_NO_WARNINGS 1


#include<stdio.h>
typedef struct A
{
	char name[101];
	double jiage;
	int shuliang;
} A;
int main()
{
	A s[101] = { 0 };
	int i = 0, n = 0;
	double sum = 0;
	scanf("%d", &n);
	for (i = 0; i < n; i++)
	{
		scanf("%s %lf %d", &s[i].name, &s[i].jiage, &s[i].shuliang);
		sum += s[i].jiage * s[i].shuliang;
	}
	printf("%lf\n", sum);

	return 0;
}